<template>
  <div class="chinaMap">
    <cheader :pageIndex="1"></cheader>
    <div class="jdBg">
      <img src="@/common/img/bg.png" alt="" class="bg">
      <div class="p1-title">
        <div class="tWrap">
          <div class="t">
            <!-- <img src="@/common/img/ball1.png" alt=""> -->
            <img src="@/common/img/ball2.png" alt="">
            <!-- <img :src="'../../common/img/common/ball'+ (parseInt(project)+1) +'.png'" alt=""> -->
            <h2>“桃李不言，大爱交大”</h2>
            <i></i>
          </div>
        </div>
        <div class="bWrap">
          <div class="b">
            <h3></h3>
            <i></i>
          </div>
        </div>
      </div>
    </div>
    <div class="map" ref="count">
      <img src="./title.png" alt="" class="title">
      <img src="./china.png" alt="" class="china">
      <button @click="goDetail">
        <font-awesome-icon icon="video" class="icon"/>
        <span>观看爱心捐赠的具体情况</span>
      </button>
    </div>
    <cfooter></cfooter>
  </div>
</template>
<script>
import cheader from '@/components/cheader/cheader'
import cfooter from '@/components/cfooter/cfooter'
import api from '@/common/js/api'
export default {
  data () {
    return {
      bg: require('@/common/img/bg.png'),
      did: ''
    }
  },
  created () {
    api.getChinaId().then(res => {
      if (res.data.result === '0') {
        this.did = res.data.data.id
      }
    })
  },
  mounted () {
    this.init()
  },
  updated () {
    this.init()
  },
  methods: {
    init () {
      let wH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
      console.log(wH)
      this.$refs.count.style.minHeight = wH - 352 + 'px'
    },
    goProject () {
      this.$router.push({
        name: 'project2'
      })
    },
    goDetail () {
      this.$router.push({
        name: 'projectDetail',
        query: {
          project: 1,
          blc: 0,
          did: this.did
        }
      })
    }
  },
  components: {
    cheader,
    cfooter
  }
}
</script>
<style lang="scss" scoped>
  $projectYellow: #d2964f;
  .chinaMap {
    .jdBg {
      background: no-repeat top center linear-gradient($projectYellow, $projectYellow, transparent);
      width: 100%;
      height: 270px;
      // background: green;
      position: relative;
      overflow: hidden;
      z-index: 1;
      .bg {
        width: 375px;
        height: 229px;
        position: absolute;
        top: 0;
        left: 50%;
        margin-left: -187px;
      }
      .title {
        width: 375px;
        height: 205px;
        position: absolute;
        bottom: 0;
        left: 50%;
        margin-left: -187px;
      }
      .p1-title {
        text-align: center;
        margin-top: 100px;
        .t {
          height: 30px;
          position: relative;
          display: inline-block;
          img {
            width: 29px;
            height: 29px;
            position: absolute;
            left: 0;
            top: 0;
          }
          h2 {
            font-size: 17px;
            color: #fff;
            position: relative;
            top: 11px;
            margin-left: 4px;
            font-weight: bold;
          }
          i {
            width: 4px;
            height: 4px;
            position: absolute;
            right: -3px;
            bottom: 0px;
            background-color: #ffe75f;
          }
        }
        .b {
          margin-top: 20px;
          display: flex;
          justify-content: space-between;
          position: relative;
          h3 {
            font-size: 20px;
            color: #fff;
            position: relative;
            z-index: 3;
          }
          i {
            color: #fff;
            font-size: 20px;
            font-style: normal;
            cursor: pointer;
          }
        }
      }
    }
    .map {
      // height: 815px;
      width: 100%;
      // background-color: #ccc;
      margin: -38px auto 50px;
      position: relative;
      z-index: 2;
      .title {
        display: block;
        width: 251px;
        height: 40px;
        display: block;
        margin: 0 auto 33px;
      }
      .china {
        display: block;
        width: 90%;
        margin: 0 auto 70px;
      }
      button {
        width: 325px;
        height: 35px;
        line-height: 35px;
        border: 0 none;
        background-color: #e8e8e8;
        display: block;
        margin: 0 auto;
        border-radius: 50px;
        cursor: pointer;
        .icon {
          display: inline-block;
          vertical-align: top;
          font-size: 14px;
          margin-top: 10px;
          margin-right: 10px;
        }
        span {
          font-size: 14px;
          color: #606060;
          font-weight: bold;
        }
      }
    }
    .cfooter {
      background-color: #e5e5e5;
      color: #595959 !important;
    }
  }
</style>
